using HengTong.Model.Interfaces;
using Microsoft.Extensions.Configuration;
using Microsoft.Extensions.DependencyInjection;

namespace HengTong.Kingdee.Eas;

public static class EasService
{
    /// <summary>
    /// 注册Eas服务
    /// </summary>
    /// <param name="services"></param>
    /// <param name="configuration"></param>
    public static void AddEasService(this IServiceCollection services, IConfiguration configuration)
    {
        // 注册金蝶EAS配置和服务
        services.Configure<KingdeeEasOptions>(configuration.GetSection("KingdeeEAS"));
        services.AddScoped<EasLogin>();
   
        // 数据同步服务
        services.AddScoped<IThirdPartyDataProvider, EasDataProvider>();
        KingdeeEASClientHelper.SetConfiguration(configuration);
    }
}